if(!window.debug_mode)debug_mode=false;function _alert(e){if(debug_mode)alert("* * * * * * * * debug_mode * * * * * * * * * *\n"+e)}GLOBAL_pMainObj={};var ar_EVENTS=[];var ar_PROP_ELEMENTS=[];var ar_BXButtonS=[];var ar_BXTaskbarSetS=[];var ar_BXToolbarS=[];var ar_BXTaskbarS={};var ar_CustomElementS=[];var ar_BXPropertiesTaskbarS=[];var ar_EVENTS_DE=[];window.as_arComp2Params={};window.as_arComp2Groups={};window.as_arComp2Templates={};window.as_arComp2TemplParams={};window.arComp2ParamsGroups={};window.arComp2Tooltips={};var pPropertybarHandlers=[];var arUnParsers=[];var arContentUnParsers=[];var arNodeUnParsers=[];var arEditorFastDialogs=[];var arToolbarSettings_default={manage:{show:true,docked:true,position:[0,0,0]},standart:{show:true,docked:true,position:[0,0,1]},style:{show:true,docked:true,position:[0,1,0]},formating:{show:true,docked:true,position:[0,2,0]},source:{show:true,docked:true,position:[1,0,0]},template:{show:true,docked:true,position:[0,1,2]}};var arTaskbarSettings_default={BXPropertiesTaskbar:{show:true,set:3,active:true},BXComponents2Taskbar:{show:true,set:2,active:true}};if(!window.arTaskbarSettings)window.arTaskbarSettings=arTaskbarSettings_default;var arTBSetsSettings_default={2:{show:true,size:200},3:{show:true,size:160}};arComp2PropGroups=[];arComponents2=[];arComponents2Length=0;function BXSearchInd(e,t){if(typeof e!="object")return-1;if(e.length){for(var r=0,n=e.length;r<n;r++)if(e[r].toString()==t.toString())return r}else{for(var r in e)if(e[r].toString()==t.toString())return r}return-1}if(!String.prototype.trim){String.prototype.trim=function(){var e,t;t=/^\s+/g;e=this.replace(t,"");t=/\s+$/g;e=e.replace(t,"");return e}}function BXCreateElement(e,t,r,n){if(!n)n=this.pDocument;var i=n.createElement(e);var o;if(t){for(o in t){if(o.substring(0,1)=="_"&&o!="__exp")i.setAttribute(o,t[o]);else i[o]=t[o]}}if(r){for(o in r)i["style"][o]=r[o]}return i}function GAttr(e,t){if(t=="className"&&!BX.browser.IsIE())t="class";var r=e.getAttribute(t,2);if(r&&r!="-1")return r;return""}function SAttr(e,t,r){if(t=="className")t="class";if(r.length<=0)e.removeAttribute(t);else e.setAttribute(t,r)}function _BXStyleParser(){_BXStyleParser.prototype.Create=function(){if(this.pFrame)return;this.pFrame=document.body.appendChild(BXCreateElement("IFRAME",{src:"javascript:void(0)",className:"bxedpopupframe",frameBorder:"no",scrolling:"no",unselectable:"on"},{position:"absolute",zIndex:"9999",left:"-1000px",top:"-1000px"},document));if(this.pFrame.contentDocument&&!BX.browser.IsIE())this.pDocument=this.pFrame.contentDocument;else this.pDocument=this.pFrame.contentWindow.document;this.pDocument.write("<html><head><style></style></head><body></body></html>");this.pDocument.close()};_BXStyleParser.prototype.Parse=function(e){try{if(BX.browser.IsIE())this.pDocument.styleSheets[0].cssText=e;else this.pDocument.getElementsByTagName("STYLE")[0].innerHTML=e}catch(e){}var t=[],r,n,i,o="",a,s,l,u={},d,p,c;if(!this.pDocument.styleSheets)return u;var f=this.pDocument.styleSheets;for(a=0,c=f.length;a<c;a++){r=f[a].rules?f[a].rules:f[a].cssRules;for(s=0,l2=r.length;s<l2;s++){if(r[s].type!=r[s].STYLE_RULE)continue;n=r[s].selectorText;i=n.split(",");for(l=0,l3=i.length;l<l3;l++){d=i[l].split(" ");d=d[d.length-1].trim();if(d.substr(0,1)=="."){d=d.substr(1);p="DEFAULT"}else{p=d.split(".");if(p.length>1)d=p[1];else d="";p=p[0].toUpperCase()}if(t[d])continue;t[d]=true;if(!u[p])u[p]=[];u[p].push({className:d,original:i[l],cssText:r[s].style.cssText})}}}return u}}var BXStyleParser=new _BXStyleParser;function _BXPopupWindow(){this.bCreated=false}_BXPopupWindow.prototype={Create:function(){if(this.pFrame)return;this.pFrame=document.body.appendChild(BX.create("IFRAME",{props:{src:"javascript:void(0)",className:"bxedpopupframe",frameBorder:"no",scrolling:"no",unselectable:"on"}}));BX.ZIndexManager.register(this.pFrame);if(this.pFrame.contentDocument&&!BX.browser.IsIE())this.pDocument=this.pFrame.contentDocument;else this.pDocument=this.pFrame.contentWindow.document;this.pDocument.open();this.pDocument.write('<html><head></head><body class="bx_popup_frame"></body></html>');this.pDocument.close();this.pDocument.body.style.margin=this.pDocument.body.style.padding="0px";this.pDocument.body.style.borderWidth="0px";this.pDocument.body.style.backgroundColor="#FFFFFF";this.pDocument.body.style.overflow="hidden";this.bCreated=true},Hide:function(e){if(!this.bShowed)return;this.pFrame.style.display="none";this.bShowed=false},GetDocument:function(){if(!this.pFrame)this.Create();return this.pDocument},Show:function(e){if(!this.pFrame)this.Create();this.pFrame.style.display="block";BX.ZIndexManager.bringToFront(this.pFrame);BX.cleanNode(this.pDocument.body);this.pDocument.body.appendChild(e.node);e.node.style.display="block";if(!e.width||!e.height){e.width=this.pDiv.offsetWidth;e.height=this.pDiv.offsetHeight}this.pFrame.style.left=e.left+"px";this.pFrame.style.top=e.top+"px";this.pFrame.width=e.width+"px";this.pFrame.height=e.height+"px";this.bShowed=true},CreateElement:BXCreateElement,CreateCustomElement:function(e,t){var r=new window[e];r.pMainObj=this;r.pDocument=this.pDocument;r.CreateElement=BXCreateElement;if(t){var n;for(n in t)r[n]=t[n]}r._Create();return r},SetCurStyles:function(){var e=this,t=document.styleSheets,r,n="",i,o;if(!t[0].cssRules){for(o=t.length-1;o>=0;o--){if(o>=t.length-2&&t[o].cssText.indexOf("bxed")!=-1)n+=t[o].cssText}}else{for(o=t.length-1;o>=0;o--){try{r=t[o].rules?t[o].rules:t[o].cssRules;for(i=0;i<r.length;i++){if(r[i].cssText)n+=r[i].cssText+"\n";else n+=r[i].selectorText+"{"+r[i].style.cssText+"}\n"}}catch(e){continue}}}this.SetStyles(n)},SetStyles:function(e,t){if(t!==false){var r=this.pDocument.getElementsByTagName("STYLE");for(i=0;i<r.length;i++)r[i].parentNode.removeChild(r[i])}if(e&&e.length>0){var n=BX.create("STYLE",{},this.pDocument);this.pDocument.getElementsByTagName("HEAD")[0].appendChild(n);if(BX.browser.IsIE())this.pDocument.styleSheets[0].cssText=e;else n.appendChild(this.pDocument.createTextNode(e))}}};var BXPopupWindow=new _BXPopupWindow;function addEvent(e,t,r,n){e["on"+t]=r;ar_EVENTS.push([e,t,r])}function addEvent1(e,t,r,n){if(e.addEventListener)e.addEventListener(t,r,n?false:n);else e["on"+t]=r}function addAdvEvent(e,t,r,n){if(e.addEventListener)e.addEventListener(t,r,n?false:n);else if(e.attachEvent)e.attachEvent("on"+t,r)}function removeAdvEvent(e,t,r,n){if(e.removeEventListener)e.removeEventListener(t,r,n?false:n);else e.detachEvent("on"+t,r)}function removeEvent(e,t,r,n){e["on"+t]=null;if(e.removeEventListener)e.removeEventListener(t,r,n?false:n);else e.detachEvent("on"+t,r)}var BXCustomElementEvents=[];function addCustomElementEvent(e,t,r,n){e.w=t;if(!e.__eventHandlers)e.__eventHandlers=[];if(!e.__eventHandlers[t]||e.__eventHandlers[t].length<=0){e.__eventHandlers[t]=[];if(e.addEventListener)e.addEventListener(t,OnCustomElementEvent,false);else e["on"+t]=OnCustomElementEvent}e.__eventHandlers[t].push([n,r])}function OnCustomElementEvent(e){if(!e)e=window.event;var t=this.__eventHandlers[e.type];for(var r=0;r<t.length;r++)t[r][1].call(t[r][0],e)}function delCustomElementEvent(e,t,r){if(!e.__eventHandlers||!e.__eventHandlers[t])return false;var n=e.__eventHandlers[t];var i=[];for(var o=0;o<n.length;o++){if(n[o][1]!=r)i.push(n[o])}n=e.__eventHandlers[t]=i;if(n.length<=0)removeEvent(e,t,OnCustomElementEvent)}function BXElementEqual(e,t){if(e==t)return true;return false;if(!e)return false;if(!t)return false;if(e.nodeType!=1)return false;if(t.nodeType!=1)return false;if(e.tagName!=t.tagName)return false;if(e.id!=t.id)return false;if(e.offsetHeight!=t.offsetHeight)return false;if(e.offsetLeft!=t.offsetLeft)return false;if(e.offsetTop!=t.offsetTop)return false;if(e.clientHeight!=t.clientHeight)return false;if(e.clientWidth!=t.clientWidth)return false;return true}function BXFindParentElement(e,t){var r,n=[],i=[];while((e=e.parentNode)!=null)n[n.length]=e;while((t=t.parentNode)!=null)i[i.length]=t;var o,a=0,s=0;if(n.length<i.length){o=n.length;s=i.length-o}else{o=i.length;a=n.length-o}for(var l=0;l<o-1;l++){if(BXElementEqual(n[l+a],i[l+s]))return n[l+a]}return n[0]}function getRealMousePos(e,t,r){if(window.event)e=window.event;if(e.pageX||e.pageY){e.realX=e.pageX;e.realY=e.pageY}else if(e.clientX||e.clientY){e.realX=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft;e.realY=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop}if(r){if(!(arFramePos=CACHE_DISPATCHER["pEditorFrame"]))CACHE_DISPATCHER["pEditorFrame"]=arFramePos=BX.pos(t.pEditorFrame);e.realX+=arFramePos.left;e.realY+=arFramePos.top;var n,i;if(BX.browser.IsIE()&&!t.bFullscreen){if(IEplusDoctype){e.realX-=document.documentElement.scrollLeft;e.realY-=document.documentElement.scrollTop}else{e.realX-=document.body.scrollLeft;e.realY-=document.body.scrollTop}}else if(!BX.browser.IsIE()&&!BX.browser.IsDoctype()){e.realX-=t.pEditorDocument.body.scrollLeft;e.realY-=t.pEditorDocument.body.scrollTop}}return e}function GetRealPos(e){if(!e||!e.offsetParent)return false;var t={left:e.offsetLeft,top:e.offsetTop},r=e.offsetParent;while(r.tagName.toUpperCase()!=="BODY"&&r.tagName.toUpperCase()!=="HTML"){t.left+=r.offsetLeft;t.top+=r.offsetTop;r=r.offsetParent}t.right=t.left+e.offsetWidth;t.bottom=t.top+e.offsetHeight;return t}function BXAlignToPos(e,t){var r=BX.GetWindowInnerSize();if(r.innerWidth<e.right||t){var n=e.right-e.left;e.right-=n;e.left-=n}if(r.innerHeight<e.bottom){var i=e.bottom-e.top;e.top-=i;e.bottom-=i}return e}function GetDisplStr(e){return e==0?"none":""}function bxhtmlspecialchars(e){if(!(typeof e=="string"||e instanceof String))return e;e=e.replace(/&/g,"&amp;");e=e.replace(/"/g,"&quot;");e=e.replace(/</g,"&lt;");e=e.replace(/>/g,"&gt;");return e}function bxhtmlunspecialchars(e){if(!(typeof e=="string"||e instanceof String))return e;e=e.replace(/\&quot;/g,'"');e=e.replace(/&#39;/g,"'");e=e.replace(/\&lt;/g,"<");e=e.replace(/\&gt;/g,">");e=e.replace(/\&amp;/g,"&");return e}function BXEventDispatcher(){this.arHandlers=[];this.arEditorHandlers=[];this.arEditors=[];BXEventDispatcher.prototype.OnEvent=function(e,t){var r;if(window.event)t=window.event;if(e["className"]&&(e.className=="pEditorDocument"||e.className=="pSourceDocument")){if(e.pMainObj.pEditorWindow.event)t=e.pMainObj.pEditorWindow.event;else if(!(r=CACHE_DISPATCHER["pEditorFrame"]))CACHE_DISPATCHER["pEditorFrame"]=r=BX.pos(e.pMainObj.pEditorFrame)}var n=pBXEventDispatcher.arHandlers[t.type];var i=n.length;if(!i)return;if(t.target)t.targetElement=t.target;else if(t.srcElement)t.targetElement=t.srcElement;if(t.targetElement.nodeType==3)t.targetElement=t.targetElement.parentNode;if(t.pageX||t.pageY){t.realX=t.pageX;t.realY=t.pageY}else if(t.clientX||t.clientY){t.realX=t.clientX+document.body.scrollLeft;t.realY=t.clientY+document.body.scrollTop}if(r){t.realX+=r["left"];t.realY+=r["top"]}var o=true;for(var a=0;a<i;a++){if(!n[a](t))o=false}return o};BXEventDispatcher.prototype.AddHandler=function(e,t){if(!this.arHandlers[e]){this.arHandlers[e]=[];for(var r=0;r<this.arEditors.length;r++){var n=this.arEditors[r];addEvent1(n.pDocument,e,function(e){pBXEventDispatcher.OnEvent(n.pDocument,e)});addEvent1(n.pEditorDocument,e,function(e){pBXEventDispatcher.OnEvent(n.pEditorDocument,e)})}}this.arHandlers[e].push(t)};BXEventDispatcher.prototype.SetEvents=function(e){for(var t in this.arHandlers){for(var r=0;r<this.arHandlers[t].length;r++)addAdvEvent(e,t,window["OnDispatcherEvent_pEditorDocument_"+name_cur_obj])}};BXEventDispatcher.prototype.__Add=function(e){for(var t in this.arHandlers){if(this.arEditors.length<=0)addAdvEvent(e.pDocument,t,window["OnDispatcherEvent_pDocument_"+name_cur_obj]);addAdvEvent(e.pEditorDocument,t,window["OnDispatcherEvent_pEditorDocument_"+name_cur_obj])}this.arEditors[this.arEditors.length]=e};BXEventDispatcher.prototype.SetCursor=function(e){for(var t=0;t<this.arEditors.length;t++){var r=this.arEditors[t];r.pDocument.body.style.cursor=e;r.pEditorDocument.body.style.cursor=e}};BXEventDispatcher.prototype.AddEditorHandler=function(e,t){if(!this.arEditorHandlers[e])this.arEditorHandlers[e]=[];this.arEditorHandlers[e][this.arEditorHandlers[e].length]=t};BXEventDispatcher.prototype.OnEditorEvent=function(e,t,r){if(!this.arEditorHandlers[e])return true;var n=true;for(var i=0;i<this.arEditorHandlers[e].length;i++)if(!this.arEditorHandlers[e][i](t,r))n=false;return n}}window.BXLoadJSFiles=function(e,t,r){var n=function(i){if(i>=e.length){t.func.apply(t.obj);return}var o=document.body.appendChild(document.createElement("script"));o.src=(!r?"/bitrix/admin/htmleditor2/":"")+e[i];if(BX.browser.IsIE()){o.onreadystatechange=function(){if(o.readyState=="loaded")n(++i)}}else{o.onload=function(){setTimeout(function(){n(++i)},50)}}};n(0)};function BXPreloader(e,t){this.oFinalCallback=t;this.arSteps=e;this.Length=e.length;this.curInd=0;this.finalLoaded=false}BXPreloader.prototype.LoadStep=function(){if(this.curInd>=this.Length){if(this.finalLoaded)return;this.finalLoaded=true;var e=this.oFinalCallback;if(!e.params)e.params=[];if(e.obj)e.func.apply(e.obj,e.params);else e.func(e.params);return}var e=this.arSteps[this.curInd];this.curInd++;if(!e.params)e.params=[];var t={obj:this,func:this.LoadStep};try{if(e.obj)e.func.call(e.obj,t,e.params);else e.func(t,e.params)}catch(e){this.LoadStep()}};BXPreloader.prototype.AddStep=function(e){this.arSteps.push(e);this.Length++};BXPreloader.prototype.RemoveStep=function(e){if(e==-1){delete this.arSteps[this.Length];this.Length--}};function BXContextMenu(){}BXContextMenu.prototype.Create=function(){this.pref=this.pMainObj.name.toUpperCase()+"_";this.oDiv=document.body.appendChild(BXCreateElement("DIV",{className:"bx_ed_context_menu",id:this.pref+"_BXContextMenu"},{position:"absolute",zIndex:1500,left:"-1000px",top:"-1000px",visibility:"hidden"},document));this.oDiv.innerHTML='<table cellpadding="0" cellspacing="0"><tr><td class="popupmenu"><table cellpadding="0" cellspacing="0" id="'+this.pref+'_BXContextMenu_items"><tr><td></td></tr></table></td></tr></table>';this.menu=new PopupMenu(this.pref+"_BXContextMenu")};BXContextMenu.prototype.Show=function(e,t,r,n,i,o,a){this.pMainObj=o;this.oPrevRange=BXGetSelectionRange(this.pMainObj.pEditorDocument,this.pMainObj.pEditorWindow);this.menu.PopupHide();if(!this.FetchAndBuildItems(n,i))return;addEvent1(this.pMainObj.pEditorDocument,"click",BXContextMenuOnclick);if(!isNaN(e))this.oDiv.style.zIndex=e;this.oDiv.style.width=parseInt(this.oDiv.firstChild.offsetWidth)+"px";var s=parseInt(this.oDiv.offsetWidth);var l=parseInt(this.oDiv.offsetHeight);r.right=r.left+s;r.bottom=r.top;this.menu.PopupShow(BXAlignToPos(r,a),dxShadowImgPath)};BXContextMenu.prototype.FetchAndBuildItems=function(e,t){var r,n,i,o=[],a,s,l=[],u,d,p=false,c=false,f;if(!t)t={};if(t&&t.bxtagname){c=t.bxtagname}else if(e&&e.arAttributes&&(f=e.arAttributes["id"])){p=this.pMainObj.GetBxTag(f);if(p&&p.tag)c=p.tag}if(c){d=c.toUpperCase();if(arCMButtons[d])for(n=0,i=arCMButtons[d].length;n<i;n++)o.push(arCMButtons[d][n])}else{if(!e)e=this.pMainObj.GetSelectionObject();t.pElement=e;for(n=0;n<arCMButtons["DEFAULT"].length;n++)o.push(arCMButtons["DEFAULT"][n]);while(e&&(r=e.parentNode)!=null){if(r.nodeType==1&&e.tagName&&(u=e.tagName.toUpperCase())&&u!="TBODY"&&!l[u]){d=u;if(e.getAttribute&&(f=e.getAttribute("id"))){p=this.pMainObj.GetBxTag(f);if(p&&p.tag)d=p.tag.toUpperCase()}l[u]=e;if(arCMButtons[d]){if(o.length>0)o.push("separator");for(n=0,i=arCMButtons[d].length;n<i;n++)o.push(arCMButtons[d][n])}}else{e=r;continue}}}if(o.length==0)return false;var h=BX(this.menu.menu_id+"_items");while(h.rows.length>0)h.deleteRow(0);return this.BuildItems(o,t,h)};BXContextMenu.prototype.BuildItems=function(e,t,r,n){var i=e.length;var o=this;var a={};this.subgroup_parent_id="";this.current_opened_id="";var s=function(){var e=BX("__curent_submenu");if(!e)return;l(e);o.current_opened_id="";o.subgroup_parent_id="";e.style.display="none";e.id=""};var l=function(e){if(!e)return;var t=e.parentNode.nextSibling;t.parentNode.className=""};var u=function(){setTimeout(function(){o.current_opened_id="";o.subgroup_parent_id=""},400)};for(var d=0;d<i;d++){var p=r.insertRow(-1);var c=p.insertCell(-1);if(e[d]=="separator"){c.innerHTML='<div class="popupseparator"></div>'}else{if(e[d].isgroup===true){var f=BX.browser.IsIE()?"arrow_ie":"arrow";c.innerHTML='<div id="_oSubMenuDiv_'+e[d].id+'" style="position: relative;"></div>'+'<table cellpadding="0" cellspacing="0" class="popupitem" id="'+e[d].id+'">\n'+"\t<tr>\n"+'\t\t<td class="gutter"></td>\n'+'\t\t<td class="item" title="'+(e[d].title?e[d].title:e[d].name)+'">'+e[d].name+"</td>\n"+'\t\t<td class="'+f+'"></td>\n'+"\t</tr>\n"+"</table>";var h=c.childNodes[1];var m={};a[e[d].id]=e[d].elements;h.onmouseover=function(e){this.className="popupitem popupitemover";var r=this;l(BX("__curent_submenu"));setTimeout(function(){if(o.current_opened_id&&o.current_opened_id==o.subgroup_parent_id){u();return}if(r.className=="popupitem")return;s();o.current_opened_id=r.id;if(!m[r.id]){var e=BX("_oSubMenuDiv_"+r.id);var n=parseInt(h.offsetWidth)+1+"px";var i=BXCreateElement("DIV",{className:"popupmenu"},{position:"absolute",zIndex:1500,left:n,top:"-1px"},document);e.appendChild(i);i.onmouseover=function(){r.parentNode.className="popup_open_cell"};m[r.id]=i;var l=i.appendChild(BXCreateElement("TABLE",{cellPadding:0,cellSpacing:0},{},document));o.BuildItems(a[r.id],t,l,r.id)}else i=m[r.id];i.style.display="block";i.id="__curent_submenu"},400)};h.onmouseout=function(e){this.className="popupitem"};continue}var v=e[d][1];var g="";if(e[d][1].iconkit)g='style="background-image:url('+image_path+"/"+e[d][1].iconkit+');" class="bxedtbutton" id="bx_btn_'+e[d][1].id+'"';else if(e[d][1].src)g='style="background-image:url('+image_path+"/"+e[d][1].src+');" ';var E='<table cellpadding="0" cellspacing="0" class="popupitem">\n'+"\t<tr>\n"+'\t\t\t<td class="gutter"><div '+g+"></div></td>\n"+'\t\t\t<td class="item" title="'+(e[d][1].title?e[d][1].title:e[d][1].name)+'"'+">"+e[d][1].name+"</td>\n"+"\t\t</tr>\n"+"\t</table>";c.innerHTML=E;var h=c.firstChild;var b=e[d][1]&&e[d][1].disablecheck?e[d][1].disablecheck(h,oBXContextMenu.pMainObj):false;if(!b){h.pMainObj=oBXContextMenu.pMainObj;h.handler=e[d][1].handler;h.cmd=e[d][1].cmd;h.onmouseover=function(e){if(n){o.subgroup_parent_id=n}else{setTimeout(function(){if(o.current_opened_id&&o.current_opened_id==o.subgroup_parent_id){u();return}s()},400)}this.className="popupitem popupitemover"};h.onmouseout=function(e){this.className="popupitem"};h.onclick=function(){o.pMainObj.SetFocus();var e=false;try{if(BX.browser.IsIE()&&!BX.browser.IsIE9())BXSelectRange(o.oPrevRange,o.pMainObj.pEditorDocument,o.pMainObj.pEditorWindow)}catch(e){}if(this.handler&&typeof this.handler=="function"&&this.handler(t)!==false)e=true;if(!e&&this.cmd)e=this.pMainObj.executeCommand(this.cmd);o.pMainObj.SetFocus();oBXContextMenu.menu.PopupHide();return e}}else{h.className="popupitem popupitemdisabled"}h.id=null}}this.oDiv.style.width=r.parentNode.offsetWidth;return true};function BXIsArrayAssoc(e){for(var t in e){if(parseInt(t)!=t)return true}return false}function BXSerializeAttr(e,t){var r={},n;for(var i=0;i<t.length;i++){n=t[i];if(e[n])r[n]=e[n]}return BXSerialize(r)}function BXUnSerializeAttr(e,t,r){var n=BXUnSerialize(e);for(var i in n)t[i]=n[i]}function BXSerialize(e,t){var r,n,i;if(typeof e=="object"){r=[];if(e instanceof Array&&!BXIsArrayAssoc(e)){for(n=0;n<e.length;n++)r.push(BXSerialize(e[n]));return"["+r.join(", ",r)+"]"}for(i in e){if(typeof e[i]!="function")r.push("'"+i+"': "+BXSerialize(e[i]))}return"{"+r.join(", ",r)+"}"}if(typeof e=="boolean"){if(e)return"true";return"false"}if(typeof e=="number")return e;r=e;r=r.replace(/\\/g,"\\\\");r=r.replace(/\n/g,"\\n");r=r.replace(/\r/g,"\\r");r=r.replace(/'/g,"\\'");return"'"+r+"'"}function BXUnSerialize(str){var res;eval("res = "+str);return res}function BXPHPVal(e,t){var r,n,i;if(typeof e=="object"){r=[];if(e instanceof Array&&!BXIsArrayAssoc(e)){for(n=0;n<e.length;n++)r.push(BXPHPVal(e[n],(t?t:"undef")+"[]"))}else{for(i in e)r.push(BXPHPVal(e[i],t?t+"["+i+"]":i))}return r.join("&",r)}if(typeof e=="boolean"){if(e)return t+"=1";return t+"=0"}return t+"="+escape(e);return t+"="+e}function BXPHPValArray(e){var t,r,n;if(typeof e=="object"){t=[];if(e instanceof Array&&!BXIsArrayAssoc(e)){for(r=0;r<e.length;r++)t.push(BXPHPValArray(e[r]));return"Array("+t.join(", ",t)+")"}for(n in e)t.push("'"+n+"'=> "+BXPHPValArray(e[n]));return"Array("+t.join(", ",t)+")"}if(typeof e=="boolean"){if(e)return"true";return"false"}if(typeof e=="number")return e;t=e;t=t.replace(/\\/g,"\\\\");t=t.replace(/'/g,"\\'");return"'"+t+"'"}var pBXEventDispatcher=new BXEventDispatcher;var BXEditorLoaded=false;var arBXEditorObjects=[];function BXEditorLoad(){if(!BXEditorLoaded){BXEditorLoaded=true;for(var e=0;e<arBXEditorObjects.length;e++)arBXEditorObjects[e].OnBeforeLoad()}}function BXEditorRegister(e){arBXEditorObjects.push(e)}function BXFindParentByTagName(e,t,r){if(e){var n=e,t=t.toUpperCase();while(n&&n.tagName){if(n.tagName&&n.tagName.toUpperCase()==t){if(r){if(r&&n.className&&n.className.indexOf(r)!=-1)return n}else{return n}}n=n.parentNode}}return false}function BXGetSelection(e,t){if(!e)e=document;if(!t)t=window;var r=false;if(t.getSelection)r=t.getSelection();else if(e.getSelection)r=e.getSelection();else if(e.selection)r=e.selection;return r}function BXGetSelectionRange(e,t){try{if(!e)e=document;if(!t)t=window;var r,n=BXGetSelection(e,t);if(n){if(e.createRange)r=n.getRangeAt(0);else r=n.createRange()}else{r=false}return r}catch(e){}}function BXSelectRange(e,t,r){if(!t)t=document;if(!r)r=window;BXClearSelection(t,r);if(t.createRange&&r.getSelection){var n=r.getSelection();n.removeAllRanges();if(e&&n.addRange)n.addRange(e)}else{if(e&&e.select)e.select()}}var preventselect=function(e){return false};function BXClearSelection(e,t){if(!e)e=document;if(!t)t=window;if(t.getSelection)t.getSelection().removeAllRanges();else e.selection.empty()}function __BXSetOptionSelected(e,t){return function(){e.selected=t}}function BXEditorUtils(){this.PHPParser=window.__PHPParser?new __PHPParser:{}}BXEditorUtils.prototype={addContentParser:function(e){arContentParsers.push(e)},addDOMHandler:function(e){arDOMHandlers.push(e)},addUnParser:function(e){arUnParsers.push(e)},addContentUnParser:function(e){arContentUnParsers.push(e)},addNodeUnParser:function(e){arNodeUnParsers.push(e)},addCssLinkToFrame:function(e,t,r){return this.addLinkToFrame(e,"stylesheet","text/css",t,r)}};BXEditorUtils.prototype.addLinkToFrame=function(e,t,r,n,i){if(!i){if(!n.contentWindow.document.getElementsByTagName)return;var i=n.contentWindow.document}var o=i.createElement("LINK");o.href=e;if(t)o.rel=t;if(r)o.type=r;var a=i.getElementsByTagName("HEAD");if(a&&a[0])a[0].appendChild(o);i=a=null;return o};BXEditorUtils.prototype.ResetSelectionState=function(e){if(BX.browser.IsIE()){e.pEditorDocument.body.contentEditable=false;e.pEditorDocument.body.contentEditable=true}else{e.pEditorDocument.designMode="off";e.pEditorDocument.designMode="on"}};BXEditorUtils.prototype.CancelEvent=function(e){return BX.PreventDefault(e)};BXEditorUtils.prototype.GetSelectionAnchor=function(e){if(!BX.browser.IsIE())return e.pEditorFrame.contentWindow.getSelection().anchorNode;var t=e.pEditorDocument.selection.createRange();var r=null;if(t.parentElement)r=t.parentElement();else if(t.item)r=t.item(0);t=null;return r};BXEditorUtils.prototype.addTaskBar=function(e,t,r,n,i){for(var o=0,a=arBXTaskbars.length;o<a;o++)if(arBXTaskbars[o].name==e)return;if(i==undefined)i=100;if(!arTaskbarSettings_default[e])arTaskbarSettings_default[e]={show:true,set:3,active:true};arBXTaskbars.push({name:e,pos:t,title:r,arParams:n,sort:i})};BXEditorUtils.prototype.createToolbar=function(e,t,r,n){if(!e)e="untitled_"+Math.random();if(!t)t=e;if(!r)r=[];if(!n)n={show:true,docked:true,position:[0,2,0]};var i=[e,t,r,n];i.appendButton=function(t,r){oBXEditorUtils.appendButton(t,r,e)};return i};BXEditorUtils.prototype.createButton=function(){};BXEditorUtils.prototype.addToolbar=function(e){arToolbars=window.arToolbars||{};arToolbars[e[0]]=[e[1],e[2]];arToolbarSettings_default[e[0]]=e[3]};BXEditorUtils.prototype.appendButton=function(e,t,r){if(!arToolbars[r])return false;arToolbars[r][1].push(t)};BXEditorUtils.prototype.addPropertyBarHandler=function(e,t){pPropertybarHandlers[e]=t};BXEditorUtils.prototype.ConvertArray2Post=function(e,t){var r="";for(var n in e){if(typeof e[n]=="object")for(var i in e[n]){if(typeof e[n][i]=="object")for(var o in e[n][i])r+="&"+t+"["+n+"]["+i+"]["+o+"]="+e[n][i][o];else r+="&"+t+"["+n+"]["+i+"]="+e[n][i]}else r+="&"+t+"["+n+"]="+BX.util.urlencode(e[n])}return r.substr(1)};function BXReplaceSpaceByNbsp(e){if(typeof e!="string")return e;e=e.replace(/\s/g,"&nbsp;");return e}BXEditorUtils.prototype.setCheckbox=function(e,t,r){t=t===true;if(r===false)e.value=t?"True":"False";else e.value=t?"Y":"N";e.checked=e.defaultChecked=t};oBXEditorUtils=new BXEditorUtils;arContentParsers=[];arDOMHandlers=[];arBXTaskbars=[];function copyObj(e){var t={},r;for(r in e){if(typeof e[r]=="object")t[r]=copyObj(e[r]);else t[r]=e[r]}return t}function compareObj(e,t){try{for(var r in e){if(typeof e[r]=="object"){if(typeof t[r]!="object"||!compareObj(e[r],t[r]))return false}else{if(e[r]!==t[r])return false}}return true}catch(e){return false}}function JS_addslashes(e){e=e.replace(/\\/g,"\\\\");e=e.replace(/\"/g,'\\"');return e}function JS_stripslashes(e){e=e.replace(/\\"/g,'"');e=e.replace(/\\\\/g,"\\");return e}function str_pad_left(e,t,r){e=String(e);if(r.length>0){var n="";var i=0;t=parseInt(t);for(var o=0,a=t-e.length;o<a;o++)n+=r;e=n+e}return e}function BXCutNode(e){while(e.childNodes.length>0)e.parentNode.insertBefore(e.childNodes[0],e);e.parentNode.removeChild(e)}function CheckChilds(e,t){if(!e||!e.childNodes)return;var r,n;for(n=e.childNodes.length-1;n>=0;n--){if(r=e.childNodes[n]){t.func.apply(t.obj,[r]);CheckChilds(r,t)}}}
//# sourceMappingURL=common.map.js